package com.example.stukotlin


fun main() {
    postItem("0")
}

fun requestToTokenAsync(cd: (String) -> Unit) {
    println("requestToKenAsync-sleep1")
    Thread.sleep(2000)
    cd("123")
}

fun createPostAsync(token: String, item: String, cb: (String) -> Unit) {
    println("createPostAsync-sleep1")
    Thread.sleep(2000)
    println("token=$token,item=$item")
}

fun postItem(item: String) {
    requestToTokenAsync(funStr(item))
}



fun funStr(item: String): (String) -> Unit {

    return fun (token:String){
        createPostAsync(token, item) { }
    }


}

